package com.tecode.service.impl;

import com.tecode.bean.Code;
import com.tecode.bean.Music;
import com.tecode.mapper.AdminMapper;
import com.tecode.mapper.CodeMapper;
import com.tecode.mapper.MusicMapper;
import com.tecode.service.MusicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Service
public class MusicServiceImpl implements MusicService {
    @Autowired
    private MusicMapper musicMapper;

    @Autowired
    private AdminMapper adminMapper;

    @Autowired
    private CodeMapper codeMapper;
    @Override
    public List<Object> selectMusicByCodeNumAndStyle() {
        return musicMapper.selectMusicByCodeNumAndStyle();
    }

    @Override
    public int savaMusic(Music music) {
        return musicMapper.savaMusic(music);
    }

    @Override
    public List<Map> getSongListByMusicName(String musicName) {
        return musicMapper.getSongListByMusicName(musicName);
    }

    @Override
    public int del(List musicIds) {

        return 0;
    }

    @Override
    public int visit(Date creatTime) {
        return adminMapper.visit(creatTime);
    }

    @Override
    public void addPlaybackVolume(Integer musicId) {
       musicMapper.addPlaybackVolume(musicId);
    }

    @Override
    public List<Map> selectDefaultSheet() {
        return musicMapper.selectDefaultSheet();
    }

    @Override
    public List<Map> selectMusicByMusicId(Integer musicId) {
        return musicMapper.selectMusicByMusicId(musicId);
    }

    @Override
    public List<Code> getMusicCodeByCodeId(Integer codeId) {
        return codeMapper.getMusicCodeByCodeId(codeId);

    }

    @Override
    public List<Map> selectMusicByCodeId(Integer codeId) {
        return musicMapper.selectMusicByCodeId(codeId);
    }

    @Override
    public List<Map> selectCollectionMusicByUserId(Integer userId) {
        return musicMapper.selectCollectionMusicByUserId(userId);
    }

    @Override
    public List<Map> getMusicsByUserId(Integer userId) {
        return musicMapper.getMusicsByUserId(userId);
    }
}
